import Vue from "vue";
import VueRouter from "vue-router";
Vue.use(VueRouter);
//这样会导致一个问题就是后续的路由不会跳出异常
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => console.log(err))
}
const routes = [
  {
    path: "/login",
    name: "login",
    component: () => import(/*webpackChunkName:'home'*/ "../pages/Login"),
  },
  // {
  //   path:"*",
  //   component: () => import(/*webpackChunkName:'page404'*/ "../pages/Page404"),
  // }
];

const router = new VueRouter({
  routes,
});

export default router;
